package org.alala.datamodels.common.query;

/**
 * Mybatis查询条件
 * <p>
 * {@link com.github.pagehelper.PageHelper}
 * </p>
 * 
 * @author huojinguang
 */
public class BasicQuery {
	/**
	 * 页码,从1开始默认值为1
	 */
	private int page = 1;
	/**
	 * 查询返回结果数,默认值为20
	 */
	private Integer pageSize = 20;

	public Integer getLimit() {
		return pageSize;
	}

	public Integer getOffset() {
		return (page - 1) * pageSize;
	}

	/**
	 * 排序
	 */
	private String orderByClause;

	/**
	 *  
	 */
	private String whereClause;

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public String getOrderByClause() {
		return orderByClause;
	}

	public void setOrderByClause(String orderByClause) {
		this.orderByClause = orderByClause;
	}

	public String getWhereClause() {
		return whereClause;
	}

	public void setWhereClause(String whereClause) {
		this.whereClause = whereClause;
	}
}
